﻿using System;
using DC2010.Objects.Data;

namespace DC2010.Conditions
{
    public class InstancesConditions
    {
        public C_CanJoinParty C_CanJoinParty { get; set; }
        public C_IsItemInHands C_IsItemInHands { get; set; }
        public C_IsItemInLeftHand C_IsItemInLeftHand { get; set; }
        public C_IsItemInRightHand C_IsItemInRightHand { get; set; }
        public C_IsItemOwner C_IsItemOwner { get; set; }
        public C_IsPartyFacing C_IsPartyFacing { get; set; }


        public InstancesConditions()
        {
            try
            {

            //all known conditions...
            ConditionInfo ei1 = Root.I.ConditionSystem.GetInfo("C_CAN_JOIN_PARTY");
            C_CanJoinParty = (C_CanJoinParty)ei1.CreateData().L;

            ConditionInfo ei2 = Root.I.ConditionSystem.GetInfo("C_IS_ITEM_IN_HANDS");
            C_IsItemInHands = (C_IsItemInHands)ei2.CreateData().L;

            ConditionInfo ei3 = Root.I.ConditionSystem.GetInfo("C_IS_ITEM_IN_LEFT_HAND");
            C_IsItemInLeftHand = (C_IsItemInLeftHand)ei3.CreateData().L;

            ConditionInfo ei4 = Root.I.ConditionSystem.GetInfo("C_IS_ITEM_IN_RIGHT_HAND");
            C_IsItemInRightHand = (C_IsItemInRightHand)ei4.CreateData().L;

            ConditionInfo ei5 = Root.I.ConditionSystem.GetInfo("C_IS_ITEM_OWNER");
            C_IsItemOwner = (C_IsItemOwner)ei5.CreateData().L;

            ConditionInfo ei6 = Root.I.ConditionSystem.GetInfo("C_IS_PARTY_FACING");
            C_IsPartyFacing = (C_IsPartyFacing)ei6.CreateData().L;

            }
            catch (Exception ex)
            {
                Root.log.Error(ex.Message);
            }
        }
    }
}
